import axios from 'axios'

export const post = (url, data) => {
    return new Promise((resolve, reject) => {
        axios({
            url,
            method: "POST",
            data
        }).then(response => {
            resolve(response.data)
        }).catch(error => {
            reject(error)
        })
    })
}

export const get = (url, data) => {
    return new Promise((resolve, reject) => {
        axios({
            url: url,
            method: "GET",
            params: data
        }).then(response => {
            resolve(response.data)
        }).catch(error => {
            reject(error)
        })
    })
}
